/*
**
**			Heroes IV
**	  Copyright 2001, The 3DO Company
**
**      dialog_garrison.h
*/
// kill the 255+ character identifier warning.  Templates tend to exceed that easily.

#ifndef DIALOG_GARRISON_H_INCLUDED
#define DIALOG_GARRISON_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <vector>
#include "army_ptr.h"
#include "bitmap_group_ptr.h"
#include "button_ptr.h"
#include "creature_array_window.h"
#include "creature_array_window_ptr.h"
#include "game_window.h"
#include "ownable_garrisonable_adv_object_ptr.h"

class t_adventure_frame;
class t_button;
class t_creature_stack;
class t_creature_select_window;
class t_player;
class t_text_window;

class t_dialog_garrison : public t_window
{
public:
	t_dialog_garrison( t_window* parent );
    void init_dialog( t_army* visiting_army, 
					  t_ownable_garrisonable_adv_object * adv_obj, 
					  t_adventure_frame* frame,
					  std::string const& name_text, 
					  std::string const& intro_text );
    
protected:

	t_bitmap_group_ptr					    m_bitmaps_ptr;
    t_adventure_frame *						m_frame;
    t_ownable_garrisonable_adv_object_ptr	m_garrison_ptr;
	t_creature_array_window_ptr				m_garrison_window_ptr;
	bool								    m_no_visiting_army;
	int									    m_selected_index;
	t_button_ptr							m_split_button;
	t_army_ptr								m_visiting_army_ptr;
	t_creature_array_window_ptr				m_visitor_window_ptr;

	void cancel_divide_mode();
    void close_click( t_button* button );
    void create_garrison_window();
	void check_drag_drop( t_creature_array_window::t_drag_drop_validate_data const & data, bool & accept );
	void check_split( t_creature_array_window::t_split_min_max_data & data );
	void creature_double_click( t_creature_array_window * window, int slot );
	void move_down_clicked( t_button * );
	void move_up_clicked( t_button * );
	void split_clicked( t_button * button );
};

#endif // DIALOG_GARRISON_H_INCLUDED

